Skip to contentSkip to conversation

Task chain for population to sysroot-native?

DISCUSSION H. Wulff 3 participants 4 messages Jun 3 – Jun 4

lore
Share & tools
lore

H. Wulff

author
#0 lore raw

Hi!

We have the need to modify some fonts at Yocto build time. So, I created a recipe for [fonttools python module](https://github.com/fonttools/fonttools) on which our recipe DEPENDS. The goal is to have the font tools available at build time of our recipe by populating to recipe-sysroot-native. Our recipe depends on fonttools like this:

```
DEPENDS =+ "fonttools-native"
```

And the fonttools recipe looks like this:

```
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=211c9e4671bde3881351f22a2901f692"

PV = "4.63.0"

SRC_URI = "git://github.com/fonttools/fonttools.git;protocol=https;branch=main"
SRCREV = "7fc2aa089b1bdc0d03157de2423e9b6681d22c20"

S = "${WORKDIR}/git"

inherit setuptools3

BBCLASSEXTEND = "native"

do_install:append() {
    install -d ${D}${bindir}
    for PYFILE in ${S}/Snippets/*.py
    do
        install -m 0755 ${PYFILE} ${D}${bindir}
    done
}
```

The problem is that nothing gets populated to recipe-sysroot-native when our receipe gets build. But the font tools package gets perfectly build stand alone.

So the question is what tasks are called when doing populate sysroot native. Where does the populate-sysroot-native task gets the files from? I had a look at ${SYSROOT_DIRS_NATIVE} and ${D}${bindir} is one of the folders. So, at least the files I added via do_install:append() should be available in recipe-sysroot-native.

Can please someone shine some light on this?

Thanks in advance.

H. Wulff

#1 lore raw
Quoted 33 lines · H. Wulff via lists.yoctoproject.org

Hi!

We have the need to modify some fonts at Yocto build time. So, I created a recipe for [fonttools python module](https://github.com/fonttools/fonttools) on which our recipe DEPENDS. The goal is to have the font tools available at build time of our recipe by populating to recipe-sysroot-native. Our recipe depends on fonttools like this:

```
DEPENDS =+ "fonttools-native"
```

And the fonttools recipe looks like this:

```
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=211c9e4671bde3881351f22a2901f692"

PV = "4.63.0"

SRC_URI = "git://github.com/fonttools/fonttools.git;protocol=https;branch=main"
SRCREV = "7fc2aa089b1bdc0d03157de2423e9b6681d22c20"

S = "${WORKDIR}/git"

inherit setuptools3

BBCLASSEXTEND = "native"

do_install:append() {
    install -d ${D}${bindir}
    for PYFILE in ${S}/Snippets/*.py
    do
        install -m 0755 ${PYFILE} ${D}${bindir}
    done
}
```
Quoted 5 lines

The problem is that nothing gets populated to recipe-sysroot-native when our receipe gets build. But the font tools package gets perfectly build stand alone.

So the question is what tasks are called when doing populate sysroot native. Where does the populate-sysroot-native task gets the files from? I had a look at ${SYSROOT_DIRS_NATIVE} and ${D}${bindir} is one of the folders. So, at least the files I added via do_install:append() should be available in recipe-sysroot-native.

Can please someone shine some light on this?

Adding native to BBCLASSEXTEND allows you to build a -native variant of your recipe, in this case it would be named 'fonttools-native-native'.

What you want instead is 'inherit native', as this is a native-only recipe and already has -native in the name it should use the native bbclass directly.

See for example meta/recipes-kernel/kern-tools/kern-tools-native_git.bb in openembedded-core.

Best regards,

Signature · 1 line
Paul Barker
author
#2 lore raw

Hi Paul,

I followed your hint and this way it works. Thanks!

But one thing I haven't figured out yet: Where does the binaries for the sysroot folder come from? From ${WORKDIR} or from the sstate-cache?

#3 lore raw
Quoted 3 lines · H. Wulff via lists.yoctoproject.org

I followed your hint and this way it works. Thanks!

But one thing I haven't figured out yet: Where does the binaries for the sysroot folder come from? From ${WORKDIR} or from the sstate-cache?

If bitbake finds a suitable item in sstate cache from previous builds, then the binaries are unpacked from there directly. Otherwise, it runs the full build, and populates sysroot content from the build (and creates an archive of them for sstate, so next time it won't have to rebuild).

Alex